home *** CD-ROM | disk | FTP | other *** search
/ Mac Format 1995 June / MacFormat 25.iso / Shareware City / Developers / OutOfPhase1.1 Source / OutOfPhase Folder / TrackDisplayScheduling.h < prev    next >
Text File  |  1994-12-10  |  5KB  |  119 lines

  1. /* TrackDisplayScheduling.h */
  2.  
  3. #ifndef Included_TrackDisplayScheduling_h
  4. #define Included_TrackDisplayScheduling_h
  5.  
  6. /* TrackDisplayScheduling module depends on */
  7. /* MiscInfo.h */
  8. /* Audit */
  9. /* Debug */
  10. /* Definitions */
  11. /* Array */
  12. /* TrackObject */
  13. /* FrameObject */
  14. /* Memory */
  15. /* Fractions */
  16. /* DataMunging */
  17. /* NoteObject */
  18. /* TieTrackPixel */
  19. /* TieTracking */
  20. /* StaffCalibration */
  21.  
  22. struct TrackDispScheduleRec;
  23. typedef struct TrackDispScheduleRec TrackDispScheduleRec;
  24.  
  25. /* forward declarations */
  26. struct TrackObjectRec;
  27. struct NoteObjectRec;
  28. struct TieIntersectListRec;
  29.  
  30. /* how much space between notes */
  31. #define EXTERNALSEPARATION (16)
  32.  
  33. /* create a new schedule state record */
  34. TrackDispScheduleRec*    NewTrackDisplaySchedule(struct TrackObjectRec* MainTrackObj);
  35.  
  36. /* dispose of schedule state record */
  37. void                                    DisposeTrackDisplaySchedule(TrackDispScheduleRec* Schedule);
  38.  
  39. /* add track to schedule list */
  40. MyBoolean                            AddTrackToDisplaySchedule(TrackDispScheduleRec* Schedule,
  41.                                                 struct TrackObjectRec* TrackObj);
  42.  
  43. /* delete a track from the schedule list */
  44. void                                    DeleteTrackFromDisplaySchedule(TrackDispScheduleRec* Schedule,
  45.                                                 struct TrackObjectRec* TrackObj);
  46.  
  47. /* apply schedule to tracks. */
  48. MyBoolean                            TrackDisplayScheduleUpdate(TrackDispScheduleRec* Schedule);
  49.  
  50. /* find out where a pixel position is located in the score.  it returns the */
  51. /* index of the frame the position is on and *OnFrame is True if it was on a frame. */
  52. /* otherwise, it returns the index of the frame that the position precedes and */
  53. /* sets *OnFrame to False.  TrackObj is the track that we want to find positions */
  54. /* with respect to. */
  55. MyBoolean                            TrackDisplayPixelToIndex(TrackDispScheduleRec* Schedule,
  56.                                                 struct TrackObjectRec* TrackObj, long PixelPosition,
  57.                                                 MyBoolean* OnFrame, long* Index);
  58.  
  59. /* mark scheduler so that it recalculates all the stuff.  the track and frame */
  60. /* index specify where recalculation has to start from, so that data before that */
  61. /* doesn't need to be updated. */
  62. void                                    TrackDisplayScheduleMarkChanged(TrackDispScheduleRec* Schedule,
  63.                                                 struct TrackObjectRec* TrackObj, long FrameIndex);
  64.  
  65. /* calculate the pixel index for a frame based on it's array index */
  66. MyBoolean                            TrackDisplayIndexToPixel(TrackDispScheduleRec* Schedule,
  67.                                                 long TrackIndex, long FrameIndex, long* Pixel);
  68.  
  69. /* get the number of tracks controlled by this scheduler */
  70. long                                    TrackDisplayGetNumTracks(TrackDispScheduleRec* Schedule);
  71.  
  72. /* look up the track index of a specific track */
  73. long                                    TrackDisplayGetTrackIndex(TrackDispScheduleRec* Schedule,
  74.                                                 struct TrackObjectRec* TrackObj);
  75.  
  76. /* get the track specified by the index (0..last func return value - 1) */
  77. struct TrackObjectRec*    TrackDisplayGetParticularTrack(TrackDispScheduleRec* Schedule,
  78.                                                 long Index);
  79.  
  80. /* get the total length of the track */
  81. MyBoolean                            TrackDisplayGetTotalLength(TrackDispScheduleRec* Schedule,
  82.                                                 long* LongestLength);
  83.  
  84. /* find out what NOTE (not frame) is at the specified location.  NIL */
  85. /* is returned if no note is there.  If the flag is clear, then it's a note, */
  86. /* otherwise it's a command.  If you intend to modify it, then pass an address */
  87. /* for FrameIndex so you know what to pass to TrackDisplayScheduleMarkChanged. */
  88. struct NoteObjectRec*    TrackDisplayGetUnderlyingNote(TrackDispScheduleRec* Schedule,
  89.                                                 long TrackIndex, MyBoolean* CommandFlag, long PixelX,
  90.                                                 long* FrameIndex);
  91.  
  92. /* find out if a certain frame should be drawn.  this is for squashing command */
  93. /* frames from channels other than the front channel */
  94. MyBoolean                            TrackDisplayShouldWeDrawIt(TrackDispScheduleRec* Schedule,
  95.                                                 long TrackIndex, long FrameIndex);
  96.  
  97. /* find out what index a measure bar should be.  if it shouldn't be a measure */
  98. /* bar, then it returns -1. */
  99. long                                    TrackDisplayMeasureBarIndex(TrackDispScheduleRec* Schedule,
  100.                                                 long FrameIndex);
  101.  
  102. /* find out the frame index for the specified measure bar.  if it can't find the */
  103. /* specified measure bar, it returns the location for the largest one less than */
  104. /* the value specified.  it returns false if calculation fails. */
  105. MyBoolean                            TrackDisplayMeasureIndexToFrame(TrackDispScheduleRec* Schedule,
  106.                                                 long MeasureBarIndex, long* FrameIndexOut);
  107.  
  108. /* find out if a measure bar should be greyed out or drawn solid.  it returns */
  109. /* true if the measure bar should be greyed. */
  110. MyBoolean                            TrackDisplayShouldMeasureBarBeGreyed(
  111.                                                 TrackDispScheduleRec* Schedule, long FrameIndex);
  112.  
  113. /* get a list of coordinates that need to be tied together */
  114. /* it might return NIL if there isn't a tie tracker. */
  115. struct TieIntersectListRec*    TrackDisplayGetTieIntervalList(TrackDispScheduleRec* Schedule,
  116.                                                 long StartX, long Width);
  117.  
  118. #endif
  119.